package cn.myzqu.ygmall.order.dao;

import cn.myzqu.ygmall.order.dto.StatisticsDTO;
import cn.myzqu.ygmall.order.dto.StatisticsForWeekDTO;
import cn.myzqu.ygmall.order.entity.OrderInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface OrderMapper extends BaseMapper<OrderInfo> {


    List<OrderInfo> selectOrderDetailByCustomerId(String customerId);

    List<OrderInfo> selectOrderDetailByCustomerIdAndStatus(@Param("customerId") String customerId, @Param("status") Byte status);

    List<OrderInfo> selectByCustomerId(@Param("customerId") String customerId, @Param("status") Byte status);

    List<StatisticsForWeekDTO>  selectSaleroomForWeek();

    /**
     * 查询订单统计分析的基础数据
     * @param period 周期
     * @return
     */
    StatisticsDTO selectStatistics(@Param("period") int period, @Param("status") Byte status);

    /**
     * 统计订单商品总成本和销售
     * @param period
     * @return
     */
    Map selectGoodsStatistics(@Param("period") int period);
}